<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .header{
            margin: auto;
            height: 300px;
            width: 192px;
            background: url("img/sha.png")no-repeat;
        }
        .q{
            font-size: 26px;
            font-weight: bold;
            text-align: center;
            font-family: "仿宋";
            color: #ffffff ;
            padding-top: 40px;
        }
        h2{
            color: #ffffff;
            font-size: 16px;
            font-weight: bold;
            font-family: "华文仿宋";
            text-align: center;
            padding-top: 90px;
        }
        #jis{
            font-size: 20px;
            margin-left: 46px;
        }
        .hour,.mit,.sed{
            background: #000;
            color: #ffffff;
        }
    </style>
</head>
<body>
<div class="header">
    <div class="q">京东秒杀</div>
    <h2>18点场倒计时</h2>
    <span id="jis">
        <span class="mm" id="h">01</span>:
        <span class="mm" id="m">00</span>:
        <span class="ss" id="s">00</span>
    </span>
</div>
<script>

    var m = document.querySelector("#m");
    var s = document.querySelector('#s');
    var m = 59;
    var s = 60;

    setInterval(function () {
        s--;
        if(s<10){
            s = "0" + s;
        }
        document.getElementById("s").innerHTML = s;
        if(s == 00){
            s = 60;
            m--;
            if(m<10){
                m = "0" + m;
            }
            if(m ==0){
                m = 59;
            }
        }
        document.getElementById("m").innerHTML = m;
    },1000)

</script>
</body>
</html>